@echo on

echo set CAMINHO=%1
set CAMINHO=%1

echo set VERSAO=%2
set VERSAO=%2

echo set VERSAOPSE=%3
set VERSAOPSE=%3

echo set BRANCH=%4
set BRANCH=%4

echo set SERVIDOR=%5
set SERVIDOR=%5

echo set TF=%6
set TF=%6

echo set FOLDER=%7
set FOLDER=%7

echo set UNIDADE=%8
set UNIDADE=%8

echo md \%FOLDER%
md \%FOLDER%

echo cd \%FOLDER%
cd \%FOLDER%

echo %TF% workspace /server:%SERVIDOR% /new work_space_temp_psecomp /noprompt
%TF% workspace /server:%SERVIDOR% /new work_space_temp_psecomp /noprompt

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/Deployment $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86 /version:T
%TF% branch %CAMINHO%/Compilados-PSEComponents/Deployment $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86 /version:T

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/Communication $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Communication /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/Communication $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Communication /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/Hosting $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Hosting /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/Hosting $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Hosting /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/ProcessManager $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/ProcessManager /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/ProcessManager $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/ProcessManager /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/AuditLogging $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/AuditLogging /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/AuditLogging $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/AuditLogging /version:T /noget

echo %TF% branch %CAMINHO%/Compilados/Settings $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Settings /version:T /noget
%TF% branch %CAMINHO%/Compilados/Settings $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Settings /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/Updater $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Updater /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/Updater $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Updater /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/LogPackager $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/LogPackager /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/LogPackager $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/LogPackager /version:T /noget

echo %TF% branch %CAMINHO%/Compilados-PSEComponents/Versions $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Versions /version:T /noget
%TF% branch %CAMINHO%/Compilados-PSEComponents/Versions $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Versions /version:T /noget

echo %TF% branch %CAMINHO%/Compilados/Tools $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Tools /version:T /noget
%TF% branch %CAMINHO%/Compilados/Tools $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/Tools /version:T /noget

echo %TF% branch %CAMINHO%/Compilados/Settings/GeneralSettings.config $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/GeneralSettings.config /version:T /noget
%TF% branch %CAMINHO%/Compilados/Settings/GeneralSettings.config $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSEComponents/GeneralSettings.config /version:T /noget

echo %TF% undo $/PSE/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSE/GeneralSettings.config
%TF% undo $/PSE/Setup/%BRANCH%/%VERSAO%/x86/Bin/PSE/GeneralSettings.config

echo %TF% branch $/PSE/Setup/%BRANCH%/%VERSAOPSE%/x86 $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/ExternalSetup/PSE /version:T /noget
%TF% branch $/PSE/Setup/%BRANCH%/%VERSAOPSE%/x86 $/PSEComponents/Setup/%BRANCH%/%VERSAO%/x86/ExternalSetup/PSE /version:T /noget

echo %UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\SetupGenerator.exe %VERSAO% %UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\
%UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\SetupGenerator.exe %VERSAO% %UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\

echo %TF% add %UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\SetupConfiguration.xml
%TF% add %UNIDADE%:\%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\x86\SetupConfiguration.xml

echo %TF% checkin /comment:"Montagem do Setup da PSEComponents da versao %VERSAO%" /notes:"Codigo Aprovado"="_svctfs" /override:"Montagem do Setup da PSEComponents da versao %VERSAO%" /recursive /noprompt
%TF% checkin /comment:"Montagem do Setup da PSEComponents da versao %VERSAO%" /notes:"Codigo Aprovado"="_svctfs" /override:"Montagem do Setup da PSEComponents da versao %VERSAO%" /recursive /noprompt

echo %TF% workspace /server:%SERVIDOR% /delete /noprompt work_space_temp_psecomp
%TF% workspace /server:%SERVIDOR% /delete /noprompt work_space_temp_psecomp

echo rd \%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\ /s /q
rd \%FOLDER%\PSEComponents\Setup\%BRANCH%\%VERSAO%\ /s /q